package com.sltx.controller;

import com.sltx.controller.base.BaseController;
import com.sltx.service.ResultService;
import com.sltx.util.PageData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * 股权分析结果
 */
@Controller
@RequestMapping("/Result")
public class ResultController extends BaseController {

    @Autowired
    private ResultService resultService;

    //条件查询已匹配企业
    @RequestMapping("/condition")
    @ResponseBody
    public Map Condition(){
        PageData pd = this.getPageData();
        if (pd.get("queryC").equals("所有")) {
            pd.put("queryC", "");
        }
        if (pd.get("industrycoD").equals("所有")) {
            pd.put("industrycoD", "");
        }
        return resultService.Condition(pd);
    }

    //条件查询未匹配企业
    @RequestMapping("/notMatch")
    @ResponseBody
    public Map notMatch(){
        PageData pd = this.getPageData();
        if (pd.get("industrycoD").equals("所有")) {
            pd.put("industrycoD", "");
        }
        return resultService.notMatch(pd);
    }

}
